package com.febs.security.domain;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

import lombok.Getter;
import lombok.Setter;

/**
 * security 用户封装类
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/6/21
 */
@Setter
@Getter
public class FebsUserDetails extends User {

    private static final long serialVersionUID = 2017845963758421135L;

    private LoginType loginType = LoginType.normal;

    private String remoteAddress;

    private String theme;

    private String avatar;

    private Long userId;

    private String email;

    private String mobile;

    private String ssex;

    private String password;

    private String loginTime;

    public FebsUserDetails(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public FebsUserDetails(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }

    @Override
    public String getPassword() {
        return password;
    }

}
